<template>
  <div id="root">
    <header>
      <div class="l-content">
        <el-button
          plain
          icon="el-icon-menu"
          size="mini"
          @click="handleMenu"
        ></el-button>
        <el-breadcrumb separator="/">
          <el-breadcrumb-item v-for="item in tags" :key="item.path" :to="{ path: item.path }">{{item.lable}}</el-breadcrumb-item>
         
        </el-breadcrumb>
      </div>
      <div class="r-content">
        <el-dropdown trigger="click" size="mini">
          <span>
            <img :src="userImage" alt="" class="user" />
          </span>
          <el-dropdown-menu slot="dropdown">
            <el-dropdown-item icon="el-icon-plus">个人中心</el-dropdown-item>
            <el-dropdown-item icon="el-icon-circle-plus">退出</el-dropdown-item>
          </el-dropdown-menu>
        </el-dropdown>
      </div>
    </header>
  </div>
</template>
<script>
import {mapState} from 'vuex'
export default {
  data() {
    return {
      userImage: require("../assets/images/user.png"),
    };
  },
  methods: {
    handleMenu() {
      this.$store.commit("collapseMenu");
    },
  },
  computed:{
    ...mapState({
      tags:state => state.tab.tabList
    })
  }
};
</script>
<style lang="less" scoped>
#root {
  height: 100%;
  width: 100%;
}
header {
  height: 100%;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.l-content {
  display: flex;
  align-items: center;
  .el-button {
    margin-right: 20px;
  }
}
.r-content {
  .user {
    width: 40px;
    height: 40px;
    border-radius: 50%;
  }
}
</style>